package com.example.demo.controller.task;

import com.example.demo.service.task.RecommendService;
import com.example.demo.utils.wordCountHelper;
import com.example.demo.vo.ResultVO;
import com.example.demo.vo.task.TaskSimpleVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/recommend")
public class RecommendController {

    @Resource
    RecommendService recommendService;

    @Resource
    wordCountHelper countHelper;

    @GetMapping("/test")
    public Map<String, Integer> test(@RequestParam String s){
        return countHelper.countWord(s);
    }

    @GetMapping("/getUsersToRecommend")
    public ResultVO<Integer> getUsersToRecommend(@RequestParam int tid,@RequestParam int strategy){
        return recommendService.getUsersToRecommend(tid,strategy);
    }

    @GetMapping("/getMyRecommend")
    public ResultVO<List<Integer>> getMyRecommend(){
        return recommendService.getMyRecommend();
    }

    @GetMapping("/ignoreRecommend")
    public ResultVO<List<Integer>> ignoreRecommend(@RequestParam int tid){
        return recommendService.ignoreRecommend(tid);
    }
}
